﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.OleDb;
using System.Reflection;
using System.IO;

namespace SGSN
{
    class Write
    {
        public SqlConnection connect;
        SqlCommand query;
        SqlDataReader dr;
        
        public void openConnection(string ID,string PassWord,string serverIP,string trusted_Connection,string database,string timeOut)
        {
            if (connect != null)
                connect.Close();
            connect = new SqlConnection("user id=" + ID + ";" +
                                     "password="+PassWord+";server="+serverIP+";" +
                                     "Trusted_Connection=" + trusted_Connection + ";" +
                                     "database=" + database + "; " +
                                     "connection timeout="+timeOut+"");
            try
            {
                connect.Open();

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
}
